from pydantic import BaseModel, Field
from typing import TypeVar, Generic, Optional, List, Literal, Dict

DataT = TypeVar("DataT")


class RespBody(BaseModel, Generic[DataT]):
    """ 响应 """
    code: int = Field(0, description='状态码')
    msg: str = Field(default="fail", description='信息摘要')
    data: Optional[DataT] = Field(None, description='响应的数据')
